package com.mmall.dao;

import com.mmall.pojo.User;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);


    int updateByPrimaryKeySelective(User record);//按对象更新(有值更新)

    int updateByPrimaryKey(User record);

    User selectUserByStuId(String stuId);

    //登录
    User selectLogin(@Param("stuId") String stuId, @Param("password") String password);

    /**
     * 修改密码
     * @param stuId
     * @param password
     * @return
     */
    int updatePwd(@Param("stuId") String stuId, @Param("password") String password);

    /**
     * 根据邮箱查找用户
     * @param email
     * @return
     */
    User selectUserByEmail(String email);

    int resetPwd(@Param("email") String email, @Param("password") String password);
}